<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <!-- 公共样式 -->
  <%- include('./page/page_com/com_css.ejs') %>
  <!-- article样式 -->
  <%- include('./page/page_news/news_header.ejs') %>
  <style>
    .comm_contBox {
      padding-top: 0;
    }
  </style>
</head>

<body>
  <!-- 公共导航 -->
  <%- include('./page/page_com/com_top.ejs') %>
  <!-- 公共导航下面 -->
  <%- include('./page/page_com/com_nav_bottom.ejs') %>
  <div class="content">
    <div class="join_connect clearfix">
      <!-- 加盟优势 -->
      <div class="join_advantage">
        <!-- 新闻左边侧栏 -->
        <!-- 左侧边栏 -->
        <div class="com_sidebar">
          <!-- 左侧边栏顶部 -->
          <div class="com_sidebar_top">
            <!-- 左侧边栏顶部标题 -->
            <div class="com_sidebar_top_title">
              <h1>热门标签</h1><i></i>
            </div>
            <!-- 左侧边栏顶部内容 -->
            <div class="com_sidebar_top_hbody">
              <% for(let i = 0;i < list.length;i++) { %>
              <h3><a href="/hot/<%- list[i].id %>" title="<%- list[i].name %>"><%- list[i].name %></a></h3>
              <% } %>
            </div>
          </div>
          <!-- 左侧边栏底部 -->
          <div class="com_sidebar_bottom">
            <!-- 左侧边栏底部标题 -->
            <div class="com_sidebar_bottom_title">联系我们</div>
            <!-- 左侧边栏底部身体 -->
            <div class="com_sidebar_bottom_hbody">
              <!--  左侧边栏底部身体-顶部 -->
              <div class="com_sidebar_bottom_hbody_top">
                <img title="裁圣男装" alt="裁圣男装定制加盟" src="/page/page_com/com_images/com_sidebar_bottom_hbody_top_img.jpg">
                <h5>裁圣私服定制</h5>
              </div>
              <!-- 左侧边栏底部身体-底部 -->
              <p>服务热线：400-636-5088</p>
              <p>邮箱：2982339462@qq.com</p>
              <p>地址：上海市青浦区华隆路1777号e通世界华新园D栋15层</p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="news_right">
      <div class="news_right_main">
        <!-- 新闻右边侧栏新闻资讯标题 -->
        <div class="news_right_main_title">
          <span>当前位置：</span>
          <a href="/index?id=1">主页</a> &gt;
          <span id="com_title" style="font-weight: normal;">
            <a href="/join?id=2">男装加盟</a> &gt;
            <%- name %>
          </span>
        </div>
        <!-- 新闻右边侧栏新闻资讯内容 -->
        <div class="news_right_main_cont">
          <h1 style="text-align:center; margin:5px 0 20px 0;"><%- name %></h1>
          <ul class="news_right_main_cont_ul">
            <!-- <% for(let i = 0;i < arr.length;i++) { %>
            <li class="news_right_main_cont_li">
              <a href="/news_article/4" class="news_right_main_cont_a" data-id="4">查看详情</a>
              <h4><b><%- arr[i].month %></b><span><%- arr[i].date %></span></h4>
              <p> <b>
                  <a data-id="4" href="/news_article/<%- arr[i].id %>" target="_blank"
                    title="<%- arr[i].title %>"><%- arr[i].title %></a></b>
                <span><%- arr[i].matter %></span>
              </p>
            </li>
            <% } %> -->
            <script type="text/template" id='hot_template'>
              {{each list}}
              <li class="news_right_main_cont_li">
                  <a href="/news_article/4" class="news_right_main_cont_a" data-id="4">查看详情</a>
                  <h4><b>{{ $value.month }}</b><span>{{ $value.date }}</span></h4>
                  <p> <b>
                      <a data-id="4" href="/news_article/{{ $value.id }}" target="_blank"
                        title="{{ $value.title }}">{{ $value.title }}</a></b>
                    <span>{{ $value.matter }}</span>
                  </p>
                </li>
              {{/each}}
            </script>
          </ul>
        </div>
        <!-- 分页 -->
        <div class="news_page">
          <ul class="pagination pagination_a pagination-sm pull-right" style="display: none;">
            <li class="page-item first disabled"><a href="#" class="page-link">首页</a></li>
            <li class="page-item prev disabled"><a href="#" class="page-link">上一页</a></li>
            <li class="page-item active"><a href="#" class="page-link">1</a></li>
            <li class="page-item"><a href="#" class="page-link">2</a></li>
            <li class="page-item next"><a href="#" class="page-link">下一页</a></li>
            <li class="page-item last"><a href="#" class="page-link">末页</a></li>
          </ul>
          <ul class="pagination_b pagination pagination-sm pull-right">
            <li class="page-item first disabled"><a href="#" class="page-link">首页</a></li>
            <li class="page-item prev disabled"><a href="#" class="page-link">上一页</a></li>
            <li class="page-item active"><a href="#" class="page-link">1</a></li>
            <li class="page-item next disabled"><a href="#" class="page-link">下一页</a></li>
            <li class="page-item last disabled"><a href="#" class="page-link">末页</a></li>
          </ul>
        </div>
        <!-- 热门产品 -->
        <div class="news_right_hot">
          <h4 class="news_right_hot_h4"> 热门产品
            <i> / Hot Products</i>
          </h4>
          <!-- 新闻右边侧栏热门产品图片 -->
          <div class="news_right_hot_image">
            <div class="news_right_hot_imageBox">
              <ul>

                <% for(let i = 0;i < image.length;i++) {%>
                <li>
                  <i>
                    <a href="javascript:;">
                      <img src="<%- image[i].site %>" alt="<%- image[i].site %>" title="<%- image[i].introduce %>">
                    </a>
                  </i>
                </li>
                <%} %>

              </ul>
            </div>
          </div>
        </div>
        <!-- 推荐咨询 -->
        <div class="news_right_cou">
          <h4 class="news_right_hot_h4"> 推荐资讯
            <i> / Recommended News</i>
          </h4>
          <div class="news_right_cou_box">
            <ul>
              <% for(let i = 0;i < info.length;i++) {%>
              <li>
                <span class="news_right_cou_span"><%- info[i].date %></span>
                <a href="#"><%- info[i].title %></a>
              </li>
              <% } %>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 公共底部 -->
  <%- include('./page/page_com/com_bottom.ejs') %>
</body>
<!-- 公共js -->
<%- include('./page/page_com/com_js.ejs') %>
<script>
  let showMain = function (pageNum, pageSize) {
    let id = Math.ceil(window.location.pathname.substr(5).replace(/[^\d|.]/g, ''));
    $.ajax({
      type: 'get',
      url: '/showMore',
      data: {
        pageNum: pageNum || 1,
        pageSize: pageSize || 15,
        id: id
      },
      success: function (data) {
        console.log(data)
        let showData = template('hot_template', { list: data[1] });
        $('.news_right_main_cont_ul').html(showData);
        $('.pagination_a').twbsPagination({
          // 总页数
          totalPages: Math.ceil(data[0][0].num / 15),
          visiblePages: 5,
          first: '首页',
          last: '末页',
          prev: '上一页',
          next: '下一页',
          // 当你点击的时候 获取页码
          onPageClick: function (evt, page) {
            showMain(page);
          }
        });
      }
    })
  }
  showMain();
</script>

</html>